<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class GoodsInsertRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
           'gname'=>'required',

           'price'=>'required',
           'vcnt'=>'required',
           
        ];
    }
    /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'gname.required' => '商品名不能为空',
            'price.required' => '商品价格不能为空',
            'vcnt.required' => '商品库存不能为空',
            
            
        ];
    }
}
